import React from 'react'
import ReactDOM from 'react-dom'

const render = () => {
  ReactDOM.render((
    <h1>这里是react的子应用</h1>
  ), document.getElementById('app'))
}

if (!window.__MICRO_WEB__) { // 没有在微前端的环境中
  render()
}

// 向外暴露生命周期钩子
export const bootstrap = () => {
  console.log('bootstrap')
}

export const mount = () => {
  render()
  console.log('mount')
}

export const unmount = () => {
  console.log('unmount')
}